// e.g., expr="({ foo: null, bar: null, 4: null })" will
// return ["foo", "bar", ...] but the list will not include "4",
// since methods accessed with '.' notation must star with a letter or _.
-function getPropertyNamesFromExpression(expr, commandHeader) {
- if (commandHeader == null) {
- commandHeader = '';
- }
-
+function getPropertyNamesFromExpression(expr, commandHeader = '') {
let obj = {};
if (!isUnsafeExpression(expr)) {
try {
Signals.addSignalMethods(AppFolderPopup.prototype);
var AppIcon = class AppIcon {
- constructor(app, iconParams) {
+ constructor(app, iconParams = {}) {
this.app = app;
this.id = app.get_id();
this.name = app.get_name();
this.actor._delegate = this;
- if (!iconParams)
- iconParams = {};
-
// Get the isDraggable property without passing it on to the BaseIcon:
let appIconParams = Params.parse(iconParams, { isDraggable: true }, true);
let isDraggable = appIconParams['isDraggable'];
const Signals = imports.signals;
var BarLevel = class {
- constructor(value, params) {
+ constructor(value, params = {}) {
if (isNaN(value))
// Avoid spreading NaNs around
throw TypeError('The bar level value must be a number');
this._overdriveStart = 1;
this._barLevelWidth = 0;
- if (params == undefined)
- params = {};
-
this.actor = new St.DrawingArea({ styleClass: params['styleClass'] || 'barlevel',
can_focus: params['canFocus'] || false,
reactive: params['reactive'] || false,
}
}
- _emitCallback(mount, contentTypes) {
- if (!contentTypes)
- contentTypes = [];
-
+ _emitCallback(mount, contentTypes = []) {
// we're not interested in win32 software content types here
contentTypes = contentTypes.filter(
type => (type != 'x-content/win32-software')
// @params can have any of the same values as in addChrome(),
// though some possibilities don't make sense. By default, @actor has
// the same params as its chrome ancestor.
- trackChrome(actor, params) {
+ trackChrome(actor, params = {}) {
let ancestor = actor.get_parent();
let index = this._findActor(ancestor);
while (ancestor && index == -1) {
let ancestorData = ancestor ? this._trackedActors[index]
: defaultParams;
- if (!params)
- params = {};
// We can't use Params.parse here because we want to drop
// the extra values like ancestorData.actor
for (let prop in defaultParams) {
}
var URLHighlighter = class URLHighlighter {
- constructor(text, lineWrap, allowMarkup) {
- if (!text)
- text = '';
+ constructor(text = '', lineWrap, allowMarkup) {
this.actor = new St.Label({ reactive: true, style_class: 'url-highlighter',
x_expand: true, x_align: Clutter.ActorAlign.START });
this._linkColor = '#ccccff';
this.destroy();
}
- destroy(reason) {
- if (!reason)
- reason = NotificationDestroyedReason.DISMISSED;
+ destroy(reason = NotificationDestroyedReason.DISMISSED) {
this.emit('destroy', reason);
}
};
}
}
- setMaxLevel(maxLevel) {
- if (maxLevel === undefined)
- maxLevel = 100;
+ setMaxLevel(maxLevel = 100) {
this._level.maxLevel = maxLevel;
}
var AggregateLayout = GObject.registerClass(
class AggregateLayout extends Clutter.BoxLayout {
- _init(params) {
- if (!params)
- params = {};
+ _init(params = {}) {
params['orientation'] = Clutter.Orientation.VERTICAL;
super._init(params);